<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
    <link rel="stylesheet" href="/assets/merchant/bootstrapSwitch.css">


    <link rel="stylesheet" href="/assets/merchant/css/addmchat.css"/>
    <link rel="stylesheet" href="__PUBLIC__/Card/css/creatcard.css"/>
    <link rel="stylesheet" type="text/css" href="/assets/merchant/bootstrap-datetimepicker.css"/>

    <script src="/assets/merchant/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
    <script src="/assets/merchant/liandong.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .filePicker{
            margin-top: -5px;
            width: 150px;
            height: 44px;
            background: #00A2D4;
            color: #fff;
            text-align: center;
            line-height: 44px;
            border-radius: 4px;
            cursor: pointer;
        }
        .file{
            position: absolute;
            left: 14px;
            top: -5px;
            width: 150px;
            height: 44px;
            line-height: 44px;
            opacity: 0;
            cursor: pointer;
        }
        .img-file{
            width: 100px;
            height: 100px;
            display: block;
            margin-left: 26px;
            margin-top: 10px;
            display: none;
        }
        .form-control{
            width: 50%;
        }
        .has-switch span, .has-switch label{
            height: auto;
        }
    </style>
</head>
<body>
{include file='public/header'/}
<section>
    <!------------------导航-------------------------->
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading">
            <ul class="breadcrumb">
                <li>
                    当前位置是&nbsp;:&nbsp;<a href="{:url('shop/shopmall',['card_id'=>$card['card_id']])}"> 积分商城</a>
                </li>
                <li class="active" style="color: #02b87f;"> 商品详情</li>
            </ul>
        </div>
        <div class="panel mgr15 mgl15">
            <div class="panel-heading addCharts" style="background:#ededed;">
                添加商品
            </div>
            <div class="panel-body">
                <form class="form-horizontal adminex-form" action="" method="post">

                    <div class="panel panel-default" id="step1">
                        <div class="panel-body">

                            <div class="pull-left alert form form-area col-sm-12 col-md-12 " style="display: block; margin-top: 0.5px;" id="form1">
                                <div class="arrow_in"></div>
                                <h4  class="card_title_detail">基本信息</h4>

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品名称:</label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        {$goods.name}
                                    </div>
                                </div>
                                <div class="form-group jifenshezhi">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">需要积分:</label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        {$goods.price}
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">库存:</label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        {$goods.stock}
                                    </div>
                                </div>
                                <div class="form-group" id="ferror2">
                                    <label class="col-sm-2 col-sm-2 control-label">缩略图</label>
                                    <div class="col-sm-10">
                                        <img src="{$goods.img}" class="val-file1 img-file"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品详情:</label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        {$goods.show}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 开始时间</label>
                                    <div class="col-sm-9 col-xs-12">
                                        {$goods.begin_time}
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label"><span class="text-danger">*</span> 结束时间</label>
                                    <div class="col-sm-9 col-xs-12">
                                        {$goods.end_time}
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        {include file='public/footer'/}
    </div>
</section>
</body>
<script src="/assets/merchant/js/commen.js" type="text/javascript" charset="utf-8"></script>
<script src="/assets/merchant/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>

<script>
    function addform() {
        $('#addcards').submit();
    };
    $(function () {
        $('#beg_time').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
        $('#end_time').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
    });

</script>
<script type="text/javascript">
    function upload(file,typed) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other',file);
        $.ajax({
            url: "{:U('Upload/uploadfile')}",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            $("." + file).attr("src", res.savapath).css("display", "block");
            $(".file-"+file).val(res.other);
            $("."+typed+"-"+file).val(res.other);
        }).fail(function (res) {
            alert("上传失败")
        });
    }
</script>


</html>
